/*
 * base_types.h
 *
 *  Created on: 2012-8-25
 *      Author: dell
 */

#ifndef BASE_TYPES_H_
#define BASE_TYPES_H_
#include<limits.h>
#ifdef __cplusplus
extern "C"
{
#endif
/**
 *  redefine the primitive types
 */
#ifdef __WIN32
typedef char i8;
typedef unsigned char u8;
typedef short i16;
typedef unsigned short u16;
typedef int i32;
typedef unsigned int u32;
typedef long long i64;
typedef unsigned long long u64;
typedef void *lpvoid;
#elif linux
typedef char i8;
typedef unsigned char u8;
typedef short i16;
typedef unsigned short u16;
typedef int i32;
typedef unsigned int u32;
typedef long long i64;
typedef unsigned long long u64;
typedef void *lpvoid;
#endif
/**
 *  the max and the min values
 */
//max
#define I8_MAX CHAR_MAX
#define U8_MAX UCHAR_MAX
#define I16_MAX SHRT_MAX
#define U16_MAX USHRT_MAX
#define I32_MAX INT_MAX
#define U32_MAX UINT_MAX
#define I64_MAX LLONG_MAX
#define U64_MAX ULONG_LONG_MAX
//min
#define I8_MIN CHAR_MIN
#define U8_MIN 0
#define I16_MIN SHRT_MIN
#define U16_MIN 0
#define I32_MIN INT_MIN
#define U32_MIN 0
#define I64_MIN LONG_LONG_MIN
#define U64_MIN 0

#ifdef __cplusplus
extern}
#endif
#endif /* BASE_TYPES_H_ */
